package com.four.marketing.service.impl;

import com.four.marketing.entity.Seckill;
import com.four.marketing.dao.SeckillDao;
import com.four.marketing.service.SeckillService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 侯新伟
 * @since 2021-12-14
 */
@Service
public class SeckillServiceImpl extends ServiceImpl<SeckillDao, Seckill> implements SeckillService {

    @Autowired
    private SeckillDao seckillDao;

    /**
     * 添加秒杀商品
     * @param seckill
     */
    @Override
    public void addSeckill(Seckill seckill) {
        seckillDao.addSeckill(seckill);
    }

    /**
     * 根据id查询
     * @param seId
     * @return
     */
    @Override
    public Seckill findSeckillId(Integer seId) {
        return seckillDao.findSeckillId(seId);
    }

    /**
     * 修改
     * @param seckill
     */
    @Override
    public void updateSeckill(Seckill seckill) {
        seckillDao.updateById(seckill);
    }

    /**
     * 删除
     * @param id
     */
    @Override
    public void deleteById(Integer id) {
        seckillDao.deleteById(id);
    }
}
